#!/usr/bin/perl

# 定义一个哈希数组
my %direction = ("N" => "North", "S" => "South", "W" => "West", "E" => "East");

# 引用哈希数组的元素
print $direction{"N"} . "\n";

# 使用keys函数获取哈希数组的索引列表
my @keys = keys(%direction);
print "@keys\n";

# 使用values函数获取哈希数组的值列表
my @values = values(%direction);
print "@values\n";

# 使用sort函数对索引列表进行排序
my @sorted_keys = sort(keys(%direction));
print "@sorted_keys\n";
